
<script>
	import { mapMutations } from 'vuex'
	export default {
		methods: {
			...mapMutations(['login']),
      getBrandInfo(){
        let flag =  this.$api.customStoreageManage.getStorage("currentBrand")
        if(flag ==undefined||flag == null ||flag == '') {
          this.$api.ajax({
            url: "/web/app-integral/get/" + this.$api.brandId,
            method: "get",
            header: {
              "Content-Type": "application/x-www-form-urlencoded"
            },
            success: (res) => {
              const {data} = res.data || {};
              console.log("dddd", data)
              this.$api.customStoreageManage.setStorage("currentBrand", data, 60)
            }
          });
        }
      }

    },
		onLaunch() {
			//#ifdef MP-WEIXIN
            const updateManager = wx.getUpdateManager()

            updateManager.onCheckForUpdate(function (res) {
                // 请求完新版本信息的回调
                console.log("has?",res.hasUpdate)
            })

            updateManager.onUpdateReady(function () {
                wx.showModal({
                    title: '更新提示',
                    content: '新版本已经准备好，是否重启应用？',
                    success: function (res) {
                        if (res.confirm) {
                            // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
                            updateManager.applyUpdate()
                        }
                    }
                })
            })

            updateManager.onUpdateFailed(function () {
                // 新版本下载失败
            })
			//#endif
			this.$api.startWxLocation()
			this.getBrandInfo()

			// uni.chooseLocation({
			//     success: function (res) {
			//         console.log('位置名称：' + res.name);
			//         console.log('详细地址：' + res.address);
			//         console.log('纬度：' + res.latitude);
			//         console.log('经度：' + res.longitude);
			//     }
			// });
		},
		onShow: function() {
		},
		onHide: function() {
		},
	}
</script>

<style lang="scss">
	@import "common/iconfont/iconfont.css";
	@import '~@/static/styles/app.scss';
  @import "static/style/base.scss";
</style>
